package com.cyf.library.thread

import android.os.Process
import java.util.concurrent.ThreadFactory

class BackgroundThreadFactory() : ThreadFactory {

    var name: String = ""

    override fun newThread(r: Runnable): Thread {
        return object : Thread(r, name) {
            override fun run() {

                Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND)
                super.run()
            }
        }
    }
}